package com.gzy.rpsm_admin.controller;

import com.gzy.rpsm_admin.pojo.Building;
import com.gzy.rpsm_admin.pojo.PageResult;
import com.gzy.rpsm_admin.pojo.ResponsePojo;
import com.gzy.rpsm_admin.service.BuildingService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;


@RestController
@Api(tags = "楼栋相关接口")
public class BuildingController {
    @Autowired
    private BuildingService buildingService;
    @ApiOperation( value = "查询漏洞分页信息",
    response = Building.class,
    responseContainer = "list",
    produces = MediaType.APPLICATION_ATOM_XML_VALUE)
@ApiImplicitParams({
        @ApiImplicitParam(name = "current",value = "当前页数",defaultValue = "1",dataType = "Integer",paramType = "query"),
        @ApiImplicitParam(name = "size",value = "页面行数",dataType = "Tnteger",paramType = "query",defaultValue = "10"),
        @ApiImplicitParam(name = "number",value = "漏洞编号",dataType = "String",paramType = "query")
})
    @GetMapping("/page/building")
    public ResponsePojo<PageResult<Building>> pageOfBuilding(@RequestParam(defaultValue = "1") Integer current,
                                                             String number,
                                                             @RequestParam(defaultValue = "10") Integer size){
        PageResult<Building> result = buildingService.PageOfBuilding(current,size,number);
        return ResponsePojo.success(result);
    }

}
